Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Editing Movies / Low-Level Movie-Editing Functions


InsertMovieSegment

The InsertMovieSegment function copies part of one movie to another. You specify the starting time and duration of the source segment and the time in the destination movie at which to place the information.

pascal OSErr InsertMovieSegment (Movie srcMovie, Movie dstMovie,
                                 TimeValue srcIn, 
                                 TimeValue srcDuration, 
                                 TimeValue dstIn);
srcMovie
Specifies the source movie for this operation. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively). The InsertMovieSegment function obtains the movie segment from the source movie specified in this parameter.
dstMovie
Specifies the destination movie for this operation. The InsertMovieSegment function places a copy of the segment, which is obtained from the source movie, into this destination movie. The dstIn parameter specifies where the segment is inserted.
srcIn
Specifies the start of the segment in the source movie. The srcDuration parameter specifies the segment's duration. This time value must be expressed in the source movie's time scale.
srcDuration
Specifies the duration of the segment in the source movie. This time value must be expressed in the source movie's time scale.
dstIn
Contains a time value specifying where the segment is to be inserted. This time value must be expressed in the destination movie's time scale.
DESCRIPTION
The InsertMovieSegment function does not change the source movie. However, the duration of the destination movie is extended to accommodate the inserted segment. You can use this function to add a segment beyond the end of the destination movie--the Movie Toolbox inserts empty space as appropriate.

You can use the InsertMovieSegment function to copy data within a single movie. If you are not copying data from one location in a movie to a different point in the same movie, the function may create new tracks, as appropriate.

Whenever possible, the Movie Toolbox uses existing tracks to store the data to be inserted. Before adding a track to the destination movie, the toolbox looks in the destination movie for tracks that have the same characteristics as the tracks in the source movie. The toolbox considers the following characteristics when searching for an appropriate track:

If the Movie Toolbox cannot find an appropriate track in the destination movie, it creates a track with the proper characteristics.

If you have assigned a progress function to the destination movie, the Movie Toolbox calls that progress function during long copy operations. For details on application-defined progress functions, see "Progress Functions" beginning on page 2-333.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
invalidDuration-2014This duration value is invalid
invalidTime-2015This time value is invalid
progressProcAborted-2019Your progress function returned an error
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996